package com.xiaotu.mapper;

import com.xiaotu.pojo.Movie;
import com.xiaotu.pojo.MovieType;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MovieMapper {
    @Select("select * from t_movie_type")
    public List<MovieType> findAll();
    @Select("select * from t_movie")
    public List<Movie> selectAll();
    @Select("select * from t_movie where id = #{id}")
    public Movie findById(Integer id);
    @Select("select * from t_movie where type_id = #{typeId}")
    public Movie findByTId(Integer typeId);
    @Update("update t_movie values(name,content,type_id) set(#{name},#{content},#(typeId)) where id = #{id}")
    public Integer updateById(Movie movie);
    @Insert("insert into t_movie (name,content,type_id) values(#{name},#{content},#{type_id})")
    public Integer insertMovie(Movie movie);
    @Delete("delete from t_movie where id = #{id}")
    public Integer deleteById(Integer id);
}
